package yunhe.biz;

import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.session.SqlSession;

import yunhe.dao.IReceiptDao;
import yunhe.entity.CusRece;
import yunhe.entity.Customer;
import yunhe.entity.EmpMsg;
import yunhe.entity.ReceiptFlow;
import yunhe.entity.Sale;
import yunhe.entity.SaleAppend;
import yunhe.util.SqlSessionFactoryUtil;

public class ReceiptBiz {

	SqlSession session =SqlSessionFactoryUtil.getSqlSession();
	IReceiptDao receiptdao = session.getMapper(IReceiptDao.class);

	public List<ReceiptFlow> searchRec(){
		List<ReceiptFlow> rec = receiptdao.searchRec();
		return rec;
	}
	
	public List<Sale> searchSales(){
		return receiptdao.searchSales();
	}
	
	
	public Sale checkSaleById(String salesId){
		return receiptdao.checkSaleById(salesId);
	}
	
	
	public Customer checkCusById(String cusId){
		return receiptdao.checkCusById(cusId);
	}
	
	public List<SaleAppend> checkSaleAppendById(String salesId){
		return receiptdao.checkSaleAppendById(salesId);
	}
	
	public EmpMsg checkEmpById(String workId){
		return receiptdao.checkEmpById(workId);
	}
	
	public List<Sale> checkSaleByCusId(String cusId){
		return receiptdao.checkSaleByCusId(cusId);
	}
	
	public List<CusRece> SaleGroupByCusId(){
		return receiptdao.SaleGroupByCusId();
	}
	
	public List<ReceiptFlow> searchReceive(){
		return receiptdao.searchReceive();
	}
	
	public List<ReceiptFlow> searchRecByDate(String begin,String end){
		
		Map<String,String> map = new HashMap<String,String>();
		map.put("begin", begin);
		map.put("end",end);
		return receiptdao.searchRecByDate(map);
	}
}
